package com.ce.pms.renovation.dao.impl;

import org.hibernate.Query;

import com.ce.pms.base.dao.impl.PmsBaseDaoImpl;
import com.ce.pms.renovation.dao.IFirstInspectionDao;
import com.ce.pms.renovation.model.FirstInspectionDO;

/**
*
* 功能描述: 竣工初验DAO FirstInspectionDaoImpl
* <p>版权所有：中企动力
* <p>未经本公司许可，不得以任何方式复制或使用本程序任何部分
*
* @author  许心炜
* Created on：  2008-12-19
* @author  许心炜
* update on：  2008-12-19
*/

public class FirstInspectionDaoImpl extends PmsBaseDaoImpl<FirstInspectionDO> implements IFirstInspectionDao{


	/**获得竣工初验DO
	 * @author  许心炜
	 *@param	inspectionRequisitionId - 验收申请ID
	 *@return 	FirstInspectionDO
	 */
	public FirstInspectionDO getFirstInspection(Long inspectionRequisitionId) {
		String hql = "from FirstInspectionDO FI where FI.inspectionRequisition.keyword = ? ";

		Query query = this.createQuery(hql, inspectionRequisitionId);

		if(query.list().size() > 0) {
			return  (FirstInspectionDO) query.list().get(0);
		}else {
			return null;
		}

	}


}
